package com.agricultural.robot.command;

import com.agricultural.robot.model.AgriculturalMachine;

/**
 * 停止命令 - 命令模式
 */
public class StopCommand implements Command {
    private AgriculturalMachine machine;

    public StopCommand(AgriculturalMachine machine) {
        this.machine = machine;
    }

    @Override
    public void execute() {
        System.out.println("执行停止命令: " + machine.getName());
        machine.stop();
    }

    @Override
    public void undo() {
        System.out.println("撤销停止命令: " + machine.getName());
        machine.start();
    }
}
